require("utils")
local utils = utils
local pairs = pairs
local rawget = rawget
local assert = assert
local setmetatable = setmetatable
local type = type

module("enchants")

head = {
	heal_hh = {
		stat = {
			healing = 35,
			spelldamage = 12,
			manareg = 7,
		},
	},
	def_cot = {
		stat = {
			cr_skill_defense = 16,
			cr_dodge = 17,
		},
	},
	ap_cenexp = {
		stat = {
			attackpower = 34,
			cr_hit = 16,
		},
	},
}

shoulders = {
	aldor_exalted = {
		stat = {
			healing = 33,
			manareg = 4,
		},
	},
	def_scryer_honored = {
		stat = {
			cr_skill_defense = 13,
		},
	},
	ap_scryer_exalted = {
		stat = {
			cr_crit = 15,
			attackpower = 20,
		}
	}
}

chest = {
	spirit = {
		stat = {
			spirit = 15,
		},
	},
	stam10 = {
		stat = {
			stamina = 10,
		},
	},
	stam8 = {
		stat = {
			stamina = 8,
		},
	},
	h150 = {
		stat = {
			maxhealth = 150,
		},
	},
	stat6 = {
		stat = {
			strength = 6,
			agility = 6,
			stamina = 6,
			spirit = 6,
			intellect = 6,
		},
	},
}

wrists = {
	healing = {
		stat = {
			healing = 30,
			spelldamage = 10,
		},
	},
	stam12 = {
		stat = {
			stamina = 12,
		},
	},
	str12 = {
		stat = {
			strength = 12,
		},
	},
}

mainhand = {
	spirit = {
		stat = {
			spirit = 20,
		},
	},
	healing = {
		stat = {
			healing = 81,
			spelldamage = 27,
		},
	},
}

hands = {
	healing = {
		stat = {
			healing = 35,
			spelldamage = 12,
		},
	},
	str15 = {
		stat = {
			strength = 15,
		},
	},
	stam10 = {
		stat = {
			stamina = 10,
		},
	},
	armor240 = {
		stat = {
			armor = 240,
		},
	},
}

-- waist = {}
-- neck = {}
-- trinket = {}

legs = {
	aldor_exalted = {
		stat = {
			healing = 66,
			spelldamage = 22,
			stamina = 20,
		},
	},
	stam_agi = {
		stat = {
			stamina = 30,
			agility = 10,
		},
	},
	stam_agi_ex = {
		stat = {
			stamina = 40,
			agility = 12,
		},
	},
	ap_agi = {
		stat = {
			attackpower = 50,
			cr_crit = 12,
		},
	},
}

feet = {
	spirit = {
		stat = {
			spirit = 5,
		},
	},
	stam10 = {
		stat = {
			stamina = 10,
		},
	},
	stam12 = {
		stat = {
			stamina = 12,
		},
	},
	agility = {
		stat = {
			agility = 12,
		},
	},
}

finger = {}
back = {
	armor120 = {
		stat = {
			armor = 120,
		},
	},
	agi12 = {
		stat = {
			agility = 12,
		},
	},
}
offhand = {
	stam18 = {
		stat = {
			stamina = 18,
		},
	},
}

function valid(enchant, slot)
	return true
end

for slot in pairs(utils.slots) do
	local table = _M[slot]
	if table then
		for _, entry in pairs(table) do
			entry.slot = slot
		end
		setmetatable(table, utils.check_mt)
	end
end
